package chapter.eighth.item46;

import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;

public class ForEachBetter {
	
	enum Face {ONE,TWO,THREE,FOUR,FIVE,SIX}
	
	public static void main(String[] args) {
		Collection<Face> faces = Arrays.asList(Face.values());
		/*for(Iterator<Face> i= faces.iterator();i.hasNext();)
			for(Iterator<Face> j=faces.iterator();j.hasNext();)
				System.out.println(i.next()+" "+j.next());
				结果是六个重复的点数，而不是三十六种*/
		for(Face face1:faces)
			for(Face face2:faces)
				System.out.println(face1+" "+face2);
	}
}
